#ifndef USERPAGE_H
#define USERPAGE_H

#include <QMainWindow>
#include "commontype.h"
#include <QInputDialog>
#include <QStandardItemModel>

namespace Ui {
class UserPage;
}

/**
 * @brief The UserPage class 普通用户使用界面，用户在该界面进行预约/签退
 */
class UserPage : public QMainWindow
{
    Q_OBJECT

public:
    explicit UserPage(StuData stuData, std::map<QString, SeatInfo> seatData, QWidget *parent = nullptr);
    ~UserPage();

signals:
    void PostEditUserPassword(StuData stuData);
    void PostEditRes(SeatInfo);
    void PostCode2Seat(QString, QString);

private slots:
    void on_pushButtonEditPasswd_clicked();
    void on_pushButtonRes_clicked();
    void UpdateUserState(StuData stuData);
    void UpdateSeatTable(std::map<QString, SeatInfo> seatData);

private:
    Ui::UserPage *ui;
    StuData stuData_;
    std::map<QString, SeatInfo> seatData_;
};

#endif // USERPAGE_H
